@mixin clearfix {
  &:after {
    content: '';
    display: table;
    clear: both;
  }
}

@mixin scrollBar {
  &::-webkit-scrollbar-track-piece {
    background: #d3dce6;
  }

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-thumb {
    background: #99a9bf;
    border-radius: 20px;
  }
}

@mixin relative {
  position: relative;
  width: 100%;
  height: 100%;
}

@mixin pct($pct) {
  width: #{$pct};
  position: relative;
  margin: 0 auto;
}

@mixin triangle($width, $height, $color, $direction) {
  $width: $width/2;
  $color-border-style: $height solid $color;
  $transparent-border-style: $width solid transparent;
  height: 0;
  width: 0;

  @if $direction==up {
    border-bottom: $color-border-style;
    border-left: $transparent-border-style;
    border-right: $transparent-border-style;
  } @else if $direction==right {
    border-left: $color-border-style;
    border-top: $transparent-border-style;
    border-bottom: $transparent-border-style;
  } @else if $direction==down {
    border-top: $color-border-style;
    border-left: $transparent-border-style;
    border-right: $transparent-border-style;
  } @else if $direction==left {
    border-right: $color-border-style;
    border-top: $transparent-border-style;
    border-bottom: $transparent-border-style;
  }
}

@mixin bg_color($color) {
  /*背景色（主打色）*/
  background-color: $color;
  [data-theme='theme1'] & {
    background-color: $color-theme1-1;
  }
  [data-theme='theme2'] & {
    background-color: $color-theme2-1;
  }
  [data-theme='theme3'] & {
    background-color: $color-theme3-1;
  }
  [data-theme='theme4'] & {
    background-color: $color-theme4-1;
  }
  [data-theme='theme5'] & {
    background-color: $color-theme5-1;
  }
  [data-theme='theme6'] & {
    background-color: $color-theme6-1;
  }
  [data-theme='theme7'] & {
    background-color: $color-theme7-1;
  }
  [data-theme='theme8'] & {
    background-color: $color-theme8-1;
  }
}

@mixin bg_primary_color($color) {
  /*背景色*/
  background-color: $color;
  [data-theme='theme1'] & {
    background-color: $color-theme1-1;
  }
  [data-theme='theme2'] & {
    background-color: $color-theme2-1;
  }
  [data-theme='theme3'] & {
    background-color: $color-theme3-1;
  }
  [data-theme='theme4'] & {
    background-color: $color-theme4-1;
  }
  [data-theme='theme5'] & {
    background-color: $color-theme5-1;
  }
  [data-theme='theme6'] & {
    background-color: $color-theme6-1;
  }
  [data-theme='theme7'] & {
    background-color: $color-theme7-2;
  }
  [data-theme='theme8'] & {
    background-color: $color-theme8-2;
  }
}

@mixin tab_bg_color($color) {
  /*标签背景色*/
  background-color: $color;
  [data-theme='theme1'] & {
    background-color: $color-theme1-1;
    color: $color-theme1-1;
  }
  [data-theme='theme2'] & {
    background-color: $color-theme2-1;
    color: $color-theme2-1;
  }
  [data-theme='theme3'] & {
    background-color: $color-theme3-1;
    color: $color-theme3-1;
  }
  [data-theme='theme4'] & {
    background-color: $color-theme4-1;
    color: $color-theme4-1;
  }
  [data-theme='theme5'] & {
    background-color: $color-theme5-1;
    color: $color-theme5-1;
  }
  [data-theme='theme6'] & {
    background-color: $color-theme6-1;
    color: $color-theme6-1;
  }
  [data-theme='theme7'] & {
    background-color: $color-theme7-2;
    color: $color-theme7-2;
  }
  [data-theme='theme7'] & {
    background-color: $color-theme8-2;
    color: $color-theme8-2;
  }
}

@mixin btn_color($color) {
  /*按钮颜色*/
  background-color: $color;
  border-color: $color;
  [data-theme='theme1'] & {
    background-color: $color-theme1-1;
    border-color: $color-theme1-1;
  }
  [data-theme='theme2'] & {
    background-color: $color-theme2-1;
    border-color: $color-theme2-1;
  }
  [data-theme='theme3'] & {
    background-color: $color-theme3-1;
    border-color: $color-theme3-1;
  }
  [data-theme='theme4'] & {
    background-color: $color-theme4-1;
    border-color: $color-theme4-1;
  }
  [data-theme='theme5'] & {
    background-color: $color-theme5-1;
    border-color: $color-theme5-1;
  }
  [data-theme='theme6'] & {
    background-color: $color-theme6-1;
    border-color: $color-theme6-1;
  }
  [data-theme='theme7'] & {
    background-color: $color-theme7-2;
    border-color: $color-theme7-2;
  }
  [data-theme='theme8'] & {
    background-color: $color-theme8-2;
    border-color: $color-theme8-2;
  }
}

@mixin radio_btn_color($color) {
  /*单选框按钮颜色*/
  background-color: $color;
  border-color: $color;
  [data-theme='theme1'] & {
    background-color: $color-theme1-1;
    border-color: $color-theme1-1;
    box-shadow: -1px 0 0 0 $color-theme1-1;
  }
  [data-theme='theme2'] & {
    background-color: $color-theme2-1;
    border-color: $color-theme2-1;
    box-shadow: -1px 0 0 0 $color-theme2-1;
  }
  [data-theme='theme3'] & {
    background-color: $color-theme3-1;
    border-color: $color-theme3-1;
    box-shadow: -1px 0 0 0 $color-theme3-1;
  }
  [data-theme='theme4'] & {
    background-color: $color-theme4-1;
    border-color: $color-theme4-1;
    box-shadow: -1px 0 0 0 $color-theme4-1;
  }
  [data-theme='theme5'] & {
    background-color: $color-theme5-1;
    border-color: $color-theme5-1;
    box-shadow: -1px 0 0 0 $color-theme5-1;
  }
  [data-theme='theme6'] & {
    background-color: $color-theme6-1;
    border-color: $color-theme6-1;
    box-shadow: -1px 0 0 0 $color-theme6-1;
  }
  [data-theme='theme7'] & {
    background-color: $color-theme7-2;
    border-color: $color-theme7-2;
    box-shadow: -1px 0 0 0 $color-theme7-2;
  }
  [data-theme='theme8'] & {
    background-color: $color-theme8-2;
    border-color: $color-theme8-2;
    box-shadow: -1px 0 0 0 $color-theme8-2;
  }
}

@mixin radio_label_color($color) {
  /*单选框文字颜色*/
  color: $color;
  [data-theme='theme1'] & {
    color: $color-theme1-1;
  }
  [data-theme='theme2'] & {
    color: $color-theme2-1;
  }
  [data-theme='theme3'] & {
    color: $color-theme3-1;
  }
  [data-theme='theme4'] & {
    color: $color-theme4-1;
  }
  [data-theme='theme5'] & {
    color: $color-theme5-1;
  }
  [data-theme='theme6'] & {
    color: $color-theme6-1;
  }
  [data-theme='theme7'] & {
    color: $color-theme7-2;
  }
  [data-theme='theme8'] & {
    color: $color-theme8-2;
  }
}

@mixin btn_reset_color($color) {
  /*空心按钮样式*/
  color: $color;
  border-color: $color;
  [data-theme='theme1'] & {
    color: $color-theme1-1;
    border-color: $color-theme1-1;
    background-color: #fff;
    &:hover {
      background-color: $color-theme1-4;
    }
  }
  [data-theme='theme2'] & {
    color: $color-theme2-1;
    border-color: $color-theme2-1;
    background-color: #fff;
    &:hover {
      background-color: $color-theme2-4;
    }
  }
  [data-theme='theme3'] & {
    color: $color-theme3-1;
    border-color: $color-theme3-1;
    background-color: #fff;
    &:hover {
      background-color: $color-theme3-4;
    }
  }
  [data-theme='theme4'] & {
    color: $color-theme4-1;
    border-color: $color-theme4-1;
    background-color: #fff;
    &:hover {
      background-color: $color-theme4-3;
    }
  }
  [data-theme='theme5'] & {
    color: $color-theme5-1;
    border-color: $color-theme5-1;
    background-color: #fff;
    &:hover {
      background-color: $color-theme5-3;
    }
  }
  [data-theme='theme6'] & {
    color: $color-theme6-1;
    border-color: $color-theme6-1;
    background-color: #fff;
    &:hover {
      background-color: $color-theme6-3;
    }
  }
  [data-theme='theme7'] & {
    color: $color-theme7-2;
    border-color: $color-theme7-2;
    background-color: #fff;
    &:hover {
      background-color: $color-theme7-4;
    }
  }
  [data-theme='theme8'] & {
    color: $color-theme8-2;
    border-color: $color-theme8-2;
    background-color: #fff;
    &:hover {
      background-color: $color-theme8-4;
    }
  }
}

@mixin border_style($width: 1px, $style: solid, $direction: false) {
  /*边框样式*/
  [data-theme='theme1'] & {
    @if $direction == top {
      border-top: $width $style $color-theme1-1;
    } @else if $direction == right {
      border-right: $width $style $color-theme1-1;
    } @else if $direction == bottom {
      border-bottom: $width $style $color-theme1-1;
    } @else if $direction == left {
      border-left: $width $style $color-theme1-1;
    } @else {
      border: $width $style $color-theme1-1;
    }
  }
  [data-theme='theme2'] & {
    @if $direction == top {
      border-top: $width $style $color-theme2-1;
    } @else if $direction == right {
      border-right: $width $style $color-theme2-1;
    } @else if $direction == bottom {
      border-bottom: $width $style $color-theme2-1;
    } @else if $direction == left {
      border-left: $width $style $color-theme2-1;
    } @else {
      border: $width $style $color-theme2-1;
    }
  }
  [data-theme='theme3'] & {
    @if $direction == top {
      border-top: $width $style $color-theme3-1;
    } @else if $direction == right {
      border-right: $width $style $color-theme3-1;
    } @else if $direction == bottom {
      border-bottom: $width $style $color-theme3-1;
    } @else if $direction == left {
      border-left: $width $style $color-theme3-1;
    } @else {
      border: $width $style $color-theme3-1;
    }
  }
  [data-theme='theme4'] & {
    @if $direction == top {
      border-top: $width $style $color-theme4-1;
    } @else if $direction == right {
      border-right: $width $style $color-theme4-1;
    } @else if $direction == bottom {
      border-bottom: $width $style $color-theme4-1;
    } @else if $direction == left {
      border-left: $width $style $color-theme4-1;
    } @else {
      border: $width $style $color-theme4-1;
    }
  }
  [data-theme='theme5'] & {
    @if $direction == top {
      border-top: $width $style $color-theme5-1;
    } @else if $direction == right {
      border-right: $width $style $color-theme5-1;
    } @else if $direction == bottom {
      border-bottom: $width $style $color-theme5-1;
    } @else if $direction == left {
      border-left: $width $style $color-theme5-1;
    } @else {
      border: $width $style $color-theme5-1;
    }
  }
  [data-theme='theme6'] & {
    @if $direction == top {
      border-top: $width $style $color-theme6-1;
    } @else if $direction == right {
      border-right: $width $style $color-theme6-1;
    } @else if $direction == bottom {
      border-bottom: $width $style $color-theme6-1;
    } @else if $direction == left {
      border-left: $width $style $color-theme6-1;
    } @else {
      border: $width $style $color-theme6-1;
    }
  }
  [data-theme='theme7'] & {
    @if $direction == top {
      border-top: $width $style $color-theme7-2;
    } @else if $direction == right {
      border-right: $width $style $color-theme7-2;
    } @else if $direction == bottom {
      border-bottom: $width $style $color-theme7-2;
    } @else if $direction == left {
      border-left: $width $style $color-theme7-2;
    } @else {
      border: $width $style $color-theme7-2;
    }
  }
  [data-theme='theme8'] & {
    @if $direction == top {
      border-top: $width $style $color-theme8-2;
    } @else if $direction == right {
      border-right: $width $style $color-theme8-2;
    } @else if $direction == bottom {
      border-bottom: $width $style $color-theme8-2;
    } @else if $direction == left {
      border-left: $width $style $color-theme8-2;
    } @else {
      border: $width $style $color-theme8-2;
    }
  }
}
@mixin border_color($important: false) {
  /*边框颜色*/
  border-color: $color-theme2-1;
  [data-theme='theme1'] & {
    @if $important {
      border-color: $color-theme1-1 !important;
    } @else {
      border-color: $color-theme1-1;
    }
  }
  [data-theme='theme2'] & {
    @if $important {
      border-color: $color-theme2-1 !important;
    } @else {
      border-color: $color-theme2-1;
    }
  }
  [data-theme='theme3'] & {
    @if $important {
      border-color: $color-theme3-1 !important;
    } @else {
      border-color: $color-theme3-1;
    }
  }
  [data-theme='theme4'] & {
    @if $important {
      border-color: $color-theme4-1 !important;
    } @else {
      border-color: $color-theme4-1;
    }
  }
  [data-theme='theme5'] & {
    @if $important {
      border-color: $color-theme5-1 !important;
    } @else {
      border-color: $color-theme5-1;
    }
  }
  [data-theme='theme6'] & {
    @if $important {
      border-color: $color-theme6-1 !important;
    } @else {
      border-color: $color-theme6-1;
    }
  }
  [data-theme='theme7'] & {
    @if $important {
      border-color: $color-theme7-2 !important;
    } @else {
      border-color: $color-theme7-2;
    }
  }
  [data-theme='theme8'] & {
    @if $important {
      border-color: $color-theme8-2 !important;
    } @else {
      border-color: $color-theme8-2;
    }
  }
}

@mixin box_shadow_color(
  $color: $color-theme2-1,
  $inset: 0,
  $offset: 0,
  $blurRadius: 0,
  $spreadRadius: 0
) {
  /*阴影颜色*/
  box-shadow: $color;
  [data-theme='theme1'] & {
    box-shadow: $inset, $offset, $blurRadius, $spreadRadius, $color-theme1-1;
  }
  [data-theme='theme2'] & {
    box-shadow: $inset, $offset, $blurRadius, $spreadRadius, $color-theme2-1;
  }
  [data-theme='theme3'] & {
    box-shadow: $inset, $offset, $blurRadius, $spreadRadius, $color-theme3-1;
  }
  [data-theme='theme4'] & {
    box-shadow: $inset, $offset, $blurRadius, $spreadRadius, $color-theme4-1;
  }
  [data-theme='theme5'] & {
    box-shadow: $inset, $offset, $blurRadius, $spreadRadius, $color-theme5-1;
  }
  [data-theme='theme6'] & {
    box-shadow: $inset, $offset, $blurRadius, $spreadRadius, $color-theme6-1;
  }
  [data-theme='theme7'] & {
    box-shadow: $inset, $offset, $blurRadius, $spreadRadius, $color-theme7-1;
  }
  [data-theme='theme7'] & {
    box-shadow: $inset, $offset, $blurRadius, $spreadRadius, $color-theme8-1;
  }
}

@mixin text_btn_color($color: $color-theme1-2, $important: false) {
  /*文字颜色*/
  color: $color;
  stroke: $color;
  [data-theme='theme1'] & {
    @if $important {
      color: $color-theme1-2 !important;
      stroke: $color-theme1-2 !important;
    } @else {
      color: $color-theme1-2;
      stroke: $color-theme1-2;
    }
  }
  [data-theme='theme2'] & {
    @if $important {
      color: $color-theme2-2 !important;
      stroke: $color-theme2-2 !important;
    } @else {
      color: $color-theme2-2;
      stroke: $color-theme2-2;
    }
  }
  [data-theme='theme3'] & {
    @if $important {
      color: $color-theme3-2 !important;
      stroke: $color-theme3-2 !important;
    } @else {
      color: $color-theme3-2;
      stroke: $color-theme3-2;
    }
  }
  [data-theme='theme4'] & {
    @if $important {
      color: $color-theme4-1 !important;
      stroke: $color-theme4-1 !important;
    } @else {
      color: $color-theme4-1;
      stroke: $color-theme4-1;
    }
  }
  [data-theme='theme5'] & {
    @if $important {
      color: $color-theme5-1 !important;
      stroke: $color-theme5-1 !important;
    } @else {
      color: $color-theme5-1;
      stroke: $color-theme5-1;
    }
  }
  [data-theme='theme6'] & {
    @if $important {
      color: $color-theme6-1 !important;
      stroke: $color-theme6-1 !important;
    } @else {
      color: $color-theme6-1;
      stroke: $color-theme6-1;
    }
  }
  [data-theme='theme7'] & {
    @if $important {
      color: $color-theme7-2 !important;
      stroke: $color-theme7-2 !important;
    } @else {
      color: $color-theme7-2;
      stroke: $color-theme7-2;
    }
  }
  [data-theme='theme8'] & {
    @if $important {
      color: $color-theme8-2 !important;
      stroke: $color-theme8-2 !important;
    } @else {
      color: $color-theme8-2;
      stroke: $color-theme8-2;
    }
  }
}

@mixin tag_color($color) {
  /*标签*/
  color: $color;
  border-color: $color;
  [data-theme='theme1'] & {
    color: $color-theme1-1;
    border-color: $color-theme1-1;
    background-color: $color-theme1-4;
  }
  [data-theme='theme2'] & {
    color: $color-theme2-1;
    border-color: $color-theme2-1;
    background-color: $color-theme2-4;
  }
  [data-theme='theme3'] & {
    color: $color-theme3-1;
    border-color: $color-theme3-1;
    background-color: $color-theme3-4;
  }
  [data-theme='theme4'] & {
    color: $color-theme4-1;
    border-color: $color-theme4-1;
    background-color: $color-theme4-3;
  }
  [data-theme='theme5'] & {
    color: $color-theme5-1;
    border-color: $color-theme5-1;
    background-color: $color-theme5-3;
  }
  [data-theme='theme6'] & {
    color: $color-theme6-1;
    border-color: $color-theme6-1;
    background-color: $color-theme6-3;
  }
  [data-theme='theme7'] & {
    color: $color-theme7-2;
    border-color: $color-theme7-2;
    background-color: $color-theme7-4;
  }
  [data-theme='theme8'] & {
    color: $color-theme8-2;
    border-color: $color-theme8-2;
    background-color: $color-theme8-4;
  }
}

@mixin tag_hover_color($color) {
  /*标签移入*/
  color: $color;
  border-color: $color;
  [data-theme='theme1'] & {
    color: $color-theme1-1;
    border-color: $color-theme1-3;
    background-color: #fff;
  }
  [data-theme='theme2'] & {
    color: $color-theme2-1;
    border-color: $color-theme2-3;
    background-color: #fff;
  }
  [data-theme='theme3'] & {
    color: $color-theme3-1;
    border-color: $color-theme3-3;
    background-color: #fff;
  }
  [data-theme='theme4'] & {
    color: $color-theme4-1;
    border-color: $color-theme4-2;
    background-color: #fff;
  }
  [data-theme='theme5'] & {
    color: $color-theme5-1;
    border-color: $color-theme5-2;
    background-color: #fff;
  }
  [data-theme='theme6'] & {
    color: $color-theme6-1;
    border-color: $color-theme6-2;
    background-color: #fff;
  }
  [data-theme='theme7'] & {
    color: $color-theme7-2;
    border-color: $color-theme7-3;
    background-color: #fff;
  }
  [data-theme='theme8'] & {
    color: $color-theme8-2;
    border-color: $color-theme8-3;
    background-color: #fff;
  }
}

@mixin list_item_selected_color($color, $backgroundColor) {
  /*列表 被选中*/
  color: $color;
  background-color: $backgroundColor;
  [data-theme='theme1'] & {
    color: $color-theme1-1;
    background-color: $color-theme1-3;
  }
  [data-theme='theme2'] & {
    color: $color-theme2-1;
    background-color: $color-theme2-3;
  }
  [data-theme='theme3'] & {
    color: $color-theme3-1;
    background-color: $color-theme3-3;
  }
  [data-theme='theme4'] & {
    color: $color-theme4-1;
    background-color: $color-theme4-2;
  }
  [data-theme='theme5'] & {
    color: $color-theme5-1;
    background-color: $color-theme5-2;
  }
  [data-theme='theme6'] & {
    color: $color-theme6-1;
    background-color: $color-theme6-2;
  }
  [data-theme='theme7'] & {
    color: $color-theme7-2;
    background-color: $color-theme7-3;
  }
  [data-theme='theme8'] & {
    color: $color-theme8-2;
    background-color: $color-theme8-3;
  }
}

@mixin list_item_hover_color($backgroundColor) {
  /*列表移入*/
  background-color: $backgroundColor;
  [data-theme='theme1'] & {
    background-color: $color-theme1-4;
  }
  [data-theme='theme2'] & {
    background-color: $color-theme2-4;
  }
  [data-theme='theme3'] & {
    background-color: $color-theme3-4;
  }
  [data-theme='theme4'] & {
    background-color: $color-theme4-3;
  }
  [data-theme='theme5'] & {
    background-color: $color-theme5-3;
  }
  [data-theme='theme6'] & {
    background-color: $color-theme6-3;
  }
  [data-theme='theme7'] & {
    background-color: $color-theme7-4;
  }
  [data-theme='theme8'] & {
    background-color: $color-theme8-4;
  }
}

@mixin step_label_color($color) {
  /*步骤条*/
  color: $color;
  [data-theme='theme1'] & {
    color: $color-theme1-1;
  }
  [data-theme='theme2'] & {
    color: $color-theme2-1;
  }
  [data-theme='theme3'] & {
    color: $color-theme3-1;
  }
  [data-theme='theme4'] & {
    color: $color-theme4-1;
  }
  [data-theme='theme5'] & {
    color: $color-theme5-1;
  }
  [data-theme='theme6'] & {
    color: $color-theme6-1;
  }
  [data-theme='theme7'] & {
    color: $color-theme7-2;
  }
  [data-theme='theme8'] & {
    color: $color-theme8-2;
  }
}
